﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;

namespace BLL
{
    public class Ebook
    {
        public Int64 Id { get; set; }
        public string Title { get; set; }
        public string CoverUrl { get; set; }
        public string Folder { get; set; }
        public float SeriesIndex { get; set; }
        public string Summary { get; set; }
        public Author Author { get; set; }
        public Publisher Publisher { get; set; }
        public Serie Serie { get; set; }
        public ObservableCollection<EbookFile> Files { get; set; }
        public List<Tag> Tags { get; set; }

        public bool Download
        {
            get
            {
                return Files.Where(f => f.Download).Count() > 0;
            }
            set
            {
                foreach (var file in Files)
                {
                    file.Download = value;
                }
            }
        }
    }
}
